GtkCssProvider: enable parsing negative GtkBorders
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 10 Jan 2011 19:13:56 +0000 (20:13 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 10 Jan 2011 19:49:14 +0000 (20:49 +0100)
this can be used as in regular CSS under some situations,
so child items overlap the parent element's border.

gtk/gtkcssprovider.c

index d7e8259a74d6d29ec64364220e83b9b0c0c315c8..2541050e8c85e98a62ac54aac0c68a16fa85dc03 100644 (file)
@@ -2682,14 +2682,14 @@ border_parse_str (const gchar  *str,
   border = gtk_border_new ();
 
   SKIP_SPACES (str);
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     return border;
 
   first = unit_parse_str (str, end_str);
   str = *end_str;
   SKIP_SPACES (str);
 
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     {
       border->left = border->right = border->top = border->bottom = (gint) first;
       *end_str = (gchar *) str;
@@ -2700,7 +2700,7 @@ border_parse_str (const gchar  *str,
   str = *end_str;
   SKIP_SPACES (str);
 
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     {
       border->top = border->bottom = (gint) first;
       border->left = border->right = (gint) second;
@@ -2712,7 +2712,7 @@ border_parse_str (const gchar  *str,
   str = *end_str;
   SKIP_SPACES (str);
 
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     {
       border->top = (gint) first;
       border->left = border->right = (gint) second;